<template>
    <div class="main">
    </div>
</template>
<script>
import { setStore, getStore, removeStore } from "../../config/mUtils";
import { getUserInfo } from "../../config/getData";
export default {
    data: function() {
        return {}
    },
    methods: {
        getUserData: async function(){
            await getUserInfo().then(res => {
                let json = res.data;
                setStore('username', json.UserName);
                setStore('userID', json.UserID);
            });
            this.jumpUrl();
        },
        jumpUrl: function(){
            this.$router.push('/');
        }
    },
    created: function() {
        let _that = this;
        let token = _that.$route.query.token;
        if (!token || token === 'null' || token === 'undefined') {
            _that.$router.push('/');
        } else {
            setStore('guid', token);
            _that.getUserData();
        }
    }
}

</script>
